home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / dsp / wefax.arc / WEFEGA.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-02-18  |  3.5 KB  |  185 lines

  1. ;;   WEFAX display code
  2.  
  3. code_seg segment
  4.      assume cs:code_seg,ds:code_seg,es:code_seg
  5.  
  6.      org 100H
  7. program  proc far
  8.      jmp go
  9.  
  10. ;;     Data here
  11.  
  12. pixword  dw 0
  13. row     dw 0
  14. column   dw 0
  15. columns  dw 628
  16. colsync  dw 624
  17. two     dw 3
  18. olddat   db 0
  19. skipit     db 0
  20. shiftr     db 7
  21. strmsg   db 13,10,'Strike any key when you are ready',13,10,'$'
  22. vpixmap  db 0,0,0,0,0,0,0,15 dup(14)
  23. normap   db 0,0,2,3,6,4,5,7,8, 9,10,11,12,13,14,15
  24. sync     db 1
  25. ;;    Code here
  26.  
  27. ;;    print the startup message
  28. go:    mov dx,offset strmsg
  29.     mov ah,9
  30.     int 21H
  31. ;;    hold for a character
  32. chk:    mov ah,01H
  33.     int 16H
  34.     cmp al,0
  35.     je chk
  36. ;;    read it
  37. getc:   mov ah,0
  38.     int 16H
  39. ;;    have BIOS give us EGA, 640x350x16 colors
  40.     mov ax,0010H
  41.     int 10H
  42. ;;    
  43. start:    mov ax,0
  44.     mov row,ax
  45.     mov column,ax
  46. ;;    wait until the DSP board says come and get it by changing the value
  47. ;;    at i/o port 304H
  48. newpix: mov dx,304H
  49.     in al,dx
  50. ;;    has it changed?
  51.     cmp al,olddat
  52. ;;    no go wait for it to change
  53.     je newpix
  54.     mov olddat,al
  55. ;;    yes read the value from i/o port 300H after checking to see if this
  56. ;;    is the end of line column limit
  57.     mov ax,columns
  58.     cmp column,ax
  59. ;;    last column, go check keyboard
  60.     jge testc
  61. ;;    no go get the next pixel
  62.     mov dx,300H
  63.     in ax,dx
  64.     
  65. ;;    shift the value to the right so that only the most significant 4 bits
  66. ;;    are left and this is what we will display as a color (one of 16)
  67.     mov cl,shiftr
  68.     shr ax,cl
  69.     cmp sync,1
  70.     jl nsync
  71.     cmp ax,0FH
  72.     jle nsync
  73.     mov bx,colsync
  74.     cmp column,bx
  75.     jl nsync
  76.     jmp testc
  77. nsync:    ;mov cl,2
  78.     ;shr ax,cl
  79.     ;mul two
  80.     and ax,0FH
  81.     mov si,ax
  82.     mov al,es:normap[si]
  83. ;;    set up for a pixel punching call to BIOS
  84.     mov ah,0CH
  85.     mov cx,column
  86.     mov dx,row
  87. ;;    draw the dot with BIOS service 10H subfunction 0CH
  88.     int 10H
  89. ;;    mov to the next column
  90.     inc column
  91. ;;    no go on and finish processing
  92.     jmp newpix
  93. ;;    Yes, set column to 0 and increment the row counter
  94. ;;    AFTER you see if you struck a key? with BIOS service 16H
  95. testc:    mov ah,01H
  96.     int 16H
  97. ;;    go see what it was if there is a character.
  98.     jnz getit
  99. ;;    are we at the bottom of the screen?
  100. goon:    mov column,0
  101. goon2:    ;cmp skipit,1
  102.     ;xor skipit,1
  103.     ;jne incr
  104.     ;jmp newpix
  105. incr:    inc row
  106. ;;    last row?
  107.     cmp row,350
  108. ;;    no go and get the first pixel of the new line
  109.     je newr
  110.     jmp newpix
  111. ;;    yes, set row to 0 and go get the first pixel of the new screen
  112. newr:    mov row,0
  113.     jmp newpix
  114. ;;    following processes keystrokes
  115. getit:  mov ah,0
  116. ;;    read it with BIOS service 16H
  117.     int 16H
  118. ;;    shift the picture right one pixel?
  119. tstr:    cmp al,'r'
  120.     jne tstl
  121.     mov column,1
  122.     jmp goon2
  123. ;;    shift the picture left one pixel?
  124. tstl:    cmp al,'l'
  125.     jne tstw
  126. newpl:  mov dx,304H
  127.     in al,dx
  128. ;;    has it changed?
  129.     cmp al,olddat
  130. ;;    no go wait for it to change
  131.     je newpl
  132.     mov olddat,al
  133.     jmp testc
  134. ;;    make the picture wider?
  135. tstw:    cmp al,'w'
  136.     jne tstn
  137.     inc columns
  138.     inc colsync
  139.     jmp testc
  140. ;;    Make the picture narrower?
  141. tstn:    cmp al,'n'
  142.     jne tsts
  143.     dec columns
  144.     dec colsync
  145.     jmp testc
  146. ;;    turn off sync ?
  147. tsts:    cmp al,'s'
  148.     jne tstu
  149.     xor sync,1
  150.     jmp testc
  151. ;;    make the signal more significant?
  152. tstu:    cmp al,'u'
  153.     jne tstd
  154.     dec shiftr
  155.     jmp testc
  156. ;;    make the signal less significant?
  157. tstd:    cmp al,'d'
  158.     jne tstq
  159.     inc shiftr
  160.     jmp testc
  161. ;;    quit?
  162. tstq:    cmp al,'q'
  163.     jne tsth
  164.     jmp stop
  165. ;;    hold still ?
  166. tsth:    cmp al,'h'
  167.     jne tstz
  168. hold:    mov ah,0
  169.     int 16H
  170.     jmp testc
  171. ;;    bye ya'll
  172. tstz:    cmp al,'z'
  173.     je top
  174.     jmp testc
  175. top:    mov row,0
  176.     jmp testc
  177. stop:   mov ax,3
  178.     int 10H
  179.     mov ah,0
  180.     int 21H
  181. program endp
  182. code_seg ends
  183.     end program
  184.  
  185.